﻿using System;

namespace BHS.TFSChangsetAnalyser.Model
{
    public class FileBasedDefaultValuesProvider : IDefaultValuesProvider
    {
        private DateTime _startDate;
        private DateTime _endDate;

        public void Initialize()
        {
            _startDate = DateTime.Now.AddMonths(-1);
            _endDate = DateTime.Now.Date; 
        }

        public void Save()
        {
            Properties.Settings.Default.Save();
        }

        public string TfsServerPath
        {
            get { return Properties.Settings.Default.TfsServerPath; }
            set { Properties.Settings.Default.TfsServerPath = value; }
        }

        public string TfsProjectPath
        {
            get { return Properties.Settings.Default.TfsProjectPath; }
            set { Properties.Settings.Default.TfsProjectPath = value; }
        }

        public bool UseDefaultCredentials
        {
            get { return Properties.Settings.Default.UseDefaultCredentials; }
            set { Properties.Settings.Default.UseDefaultCredentials = value; }
        }

        public string Username
        {
            get { return Properties.Settings.Default.Username; }
            set { Properties.Settings.Default.Username = value; }
        }

        public string Domain
        {
            get { return Properties.Settings.Default.Domain; }
            set { Properties.Settings.Default.Domain = value; }
        }

        public DateTime StartDate
        {
            get { return _startDate; }
        }

        public DateTime EndDate
        {
            get { return _endDate; }
        }
    }
}
